package com.cnebula.dataprocess.task.center.message;

import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Serializable;

import com.google.gson.Gson;

public class MainTaskMessage implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	String id;
	String dsType;
	
	Connection connection;
	
	DatatableMapping datatableMapping;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDsType() {
		return dsType;
	}

	public void setDsType(String dsType) {
		this.dsType = dsType;
	}

	public Connection getConnection() {
		return connection;
	}

	public void setConnection(Connection connection) {
		this.connection = connection;
	}

	
	public DatatableMapping getDatatableMapping() {
		return datatableMapping;
	}

	public void setDatatableMapping(DatatableMapping datatableMapping) {
		this.datatableMapping = datatableMapping;
	}

	public static void main(String[] args){
		Gson gson = new Gson();
		MainTaskMessage msg = new MainTaskMessage();
//		Connection conn = new Connection();
//		conn.setCharset("utf-8");
//		conn.setDatabase("_100000");
//		conn.setHost("222.29.77.90");
//		conn.setPort(3306);
//		conn.setUsername("calis");
//		conn.setPassword("calis");
//		
//		msg.setConnection(conn);
//		System.out.println(gson.toJson(msg));
		
		Reader json = new InputStreamReader(msg.getClass().getResourceAsStream("/PreOrderBook.json"));
		MainTaskMessage obj = gson.fromJson(json, MainTaskMessage.class);
		
		System.out.println(gson.toJson(obj));
		
		
	}
	
}
